package com.version.manager.controller.shop;

import com.version.manager.controller.BaseController;
import com.version.manager.entity.Shop.shopCar;
import com.version.manager.model.Msg;
import com.version.manager.rabbitmq.MQSender;
import com.version.manager.service.Shop.shopCarService;
import com.version.manager.vo.shopCarInput;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Api(value = "shopGoodsController")
@RequestMapping("/api/shop/shopCar")
public class shopCarController extends BaseController<shopCarService, shopCar> {
    @Autowired
    private shopCarService service;
    @PostMapping("saveCar")
    @ResponseBody
    public Msg saveCar(@RequestBody shopCarInput car){
        service.save(car);
        return Msg.success();
    }

    @GetMapping("addminusItem")
    @ResponseBody
    public Msg addminusItem(String userId,String storeId,int count){
        service.addminusItem(userId,storeId,count);
        return Msg.success();
    }

    @GetMapping("getCar")
    @ResponseBody
    public Msg getCar(String userId){
        return service.getCar(userId);
    }
}
